<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/10/26
  Time: 11:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<table border="1" cellspacing="0" width="600px" align="center">
    <tr>
        <td width="10%">序号</td>
        <td width="65%">商品名称</td>
        <td width="10%">价格</td>
        <td width="15%">操作</td>
    </tr>
    <c:forEach var="c" items="${pageBean.pageList}" varStatus="status">
        <c:choose>
            <c:when test="${status.count%2==0}">
                <tr style="background-color: lightsalmon">
                    <td>${status.count}</td>
                    <td>${c.pname}</td>
                    <td>${c["market_price"]}</td>
                    <td><a href="${pageContext.request.contextPath}/updateServlet?pid=${c.pid}">修改 </a><a onclick="return confirm('确认删除吗？')" href="${pageContext.request.contextPath}/deleteServlet?pid=${c.pid}"> 删除</a></td>
                </tr>
            </c:when>
            <c:otherwise>
                <tr style="background-color: lightcoral">
                    <td>${status.count}</td>
                    <td>${c.pname}</td>
                    <td>${c["market_price"]}</td>
                    <td><a href="${pageContext.request.contextPath}/updateServlet?pid=${c.pid}">修改 </a><a onclick="return confirm('确认删除吗？')" href="${pageContext.request.contextPath}/deleteServlet?pid=${c.pid}"> 删除</a></td>
                </tr>
            </c:otherwise>
        </c:choose>
    </c:forEach>
</table>
<hr>
第${pageBean.currentPage}页/共${pageBean.pageCount}页
<%--${pageBean.currentPage+1}--%>
<a href="${pageContext.request.contextPath}/pageServlet?pageBean.currentPage=${pageBean.currentPage+1}">下一页</a>
</body>
</html>
